/*
 * @Description: 流程管理
 * @Author: wangwangwang
 * @Date: 2020-08-29 11:46:11
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-03-03 13:53:50
 */
import request from '@/utils/request'

/**
 * @Description: 获取流程编码
 * @Param: 
 * @Author: wangwangwang
 */
export function getFlowsCode(data) {
	return request({
		url: '/workflow/system/sign/process/rule/get_process_code',
		method: 'get',
		params: data
	})
}
/**
 * @Description: 流程保存接口
 * @Param: 
 * @Author: wangwangwang
 */
export function saveWorkFlow(data) {
	return request({
		url: '/workflow/system/sign/task/center/save',
		// url: '/workflow/system/sign/process/instance/edit_task_content',
		method: 'post',
		data
	});
}
/**
 * @Description: 发起流程接口
 * @Param: 
 * @Author: wangwangwang
 */
export function submitTask(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/submit_task',
		method: 'post',
		data
	})
}
/**
 * @Description: 获取审批人接口
 * @Param: 
 * @Author: wangwangwang
 */
export function previewProcess(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/preview_process',
		method: 'post',
		data
	})
}
/**
 * @Description: 流程提交接口
 * @Param: 
 * @Author: wangwangwang
 */
export function submitApproval(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/submit_approval',
		method: 'post',
		data
	})
}
/**
 * @Description: 获取流程审批节点接口
 * @Param: 
 * @Author: wangwangwang
 */
export function getNodeList(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/get_node_list',
		method: 'get',
		params: data
	})
}
/**
 * @Description: 获取流程的流程图
 * @Param: 
 * @Author: wangwangwang
 */
export function getNodeListImage(data) {
	return request({
		url: '/workflow/system/sign/process/instance/get_node_list',
		method: 'get',
		params: data
	})
}
/**
 * @Description: 获取流程表单信息
 * @Param: 
 * @Author: wangwangwang
 */
export function getTaskInstance(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/get_task_instance',
		method: 'get',
		params: data
	})
}
/**
 * @Description: 代办获取流程信息
 * @Param: 
 * @Author: wangwangwang
 */
export function getTaskDetails(data) {
	return request({
		url: '/workflow/system/sign/task/center/getTaskDetails',
		method: 'post',
		data
	})
}
/**
 * @Description: 通过ID预览审批人
 * @Param: 
 * @Author: wangwangwang
 */
export function previewUser(data) {
	return request({
		url: '/base/system/user/preview_user',
		method: 'post',
		data,
	})
}
/**
 * @Description: 抄送、协审、加签
 * @Param: 
 * @Author: wangwangwang
 */
export function addApprover(data) {
	return request({
		url: '/workflow/system/sign/process/instance/node/add_approver',
		method: 'post',
		data,
	})
}
/**
 * @Description: 交办
 * @Param: 
 * @Author: wangwangwang
 */
export function assignmentApprover(params) {
	return request({
		url: '/workflow/system/sign/process/instance/node/assignment_approver',
		method: 'get',
		params,
	})
}
/**
 * @Description: 撤销任务
 * @Param: 
 * @Author: wangwangwang
 */
export function cancelTask(params) {
	return request({
		url: '/workflow/system/sign/task/center/cancel_task',
		method: 'get',
		params,
	})
}

/**
 * @Description: 回退
 * @Param: 
 * @Author: wangwangwang
 */
export function backPrefixNode(params) {
	return request({
		url: '/workflow/system/sign/process/instance/node/back_prefix_node',
		method: 'get',
		params,
	})
}

/**
 * @Description: 强制编辑
 * @Param: 
 * @Author: wangwangwang
 */
export function editTaskContent(data) {
	return request({
		url: '/workflow/system/sign/process/instance/edit_task_content', 
		method: 'post',
		data,
	})
}

